#ifndef CAFFEINE_MATH_VECTOR_HPP
#define CAFFEINE_MATH_VECTOR_HPP

#include "Box2D/Common/b2Math.h"

#include "SFML/Graphics/RenderWindow.hpp"
#include "SFML/System/Vector2.hpp"

namespace Math
{
	template< typename Type >
	struct Vector
	{
		Vector( const Type initX = 0, const Type initY = 0 )
		: x( initX ), y( initY )
		{
		}

		Vector( const Vector< Type > &vec )
		: x( vec.x ), y( vec.y )
		{
		}

		~Vector( void )
		{
		}

		bool operator==( const Vector< Type > &vec ) const
		{
			return ( x == vec.x && y == vec.y );
		}

		bool operator!=( const Vector< Type > &vec ) const
		{
			return !( *this == vec );
		}

		const Vector< Type > operator+( const Vector< Type > &vec ) const
		{
			return Vector< Type >( x + vec.x, y + vec.y );
		}

		const Vector< Type > &operator+=( const Vector< Type > &vec )
		{
			x += vec.x;
			y += vec.y;

			return *this;
		}

		const Vector< Type > operator-( void ) const
		{
			return Vector< Type >( -x, -y );
		}

		const Vector< Type > operator-( const Vector< Type > &vec ) const
		{
			return Vector< Type >( x - vec.x, y - vec.y );
		}

		const Vector< Type > &operator-=( const Vector< Type > &vec )
		{
			x -= vec.x;
			y -= vec.y;

			return *this;
		}

		const Vector< Type > operator*( const Type scalar ) const
		{
			return Vector< Type >( x * scalar, y * scalar );
		}

		const Vector< Type > &operator*=( const Type scalar )
		{
			return ( *this ) * scalar;
		}

		const Vector< Type > operator/( const Type scalar ) const
		{
			return Vector< Type >( x / scalar, y / scalar );
		}

		const Vector< Type > &operator/=( const Type scalar )
		{
			return ( *this ) / scalar;
		}

		Type x;
		Type y;
	};

	typedef Vector< float > Vectorf;
}

#endif //CAFFEINE_MATH_VECTOR_HPP